#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const int MAXN = 2e5 + 10;
const int MOD = 998244353;

ll n,k,x;
ll a[MAXN];

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    cin >> n >> k >> x;
    for (int i = 1; i <= n; i++) cin >> a[i];

    for (int i = 1; i <= n; i++) {
        ll b = min(k, a[i] / x);
        a[i] -= b*x;
        k -= b;
    }

    if (k > 0) {
        sort(a+1, a+1+n);
        for (int i = n; i >= 1; i--) {
            if (a[i] == 0 || k == 0) break;
            a[i] = 0;
            k--;
        }
    }
    ll res = 0;
    for (int i = 1; i <= n; i++) res += a[i];
    cout << res << endl;
    return 0;
}